package com.example.demo.controller;

import com.example.demo.model.TestProperties;
import com.example.demo.model.TestProperties1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Hello {
    @Autowired
    private TestProperties testProperties;
    @Autowired
    private TestProperties1 testProperties1;
    @RequestMapping("/index")
    public String index(){
        return "hello world" +testProperties.toString() + testProperties1.toString();
    }

    @RequestMapping("/hello")
    public String hello(@Value("${test}")String str){
        return str;
    }
}
